const Router = require('koa-router');
const categoryController = require('../controllers/categoryController');
const auth = require('../middleware/auth');

const router = new Router({ prefix: '/categories' });

// 需要鉴权的接口
router.post('/', auth, categoryController.createCategory);
router.get('/', auth, categoryController.getCategories);
router.put('/:id', auth, categoryController.updateCategory);
router.delete('/:id', auth, categoryController.deleteCategory);

module.exports = router;
